package test.designmode.factory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Executors是静态工厂
 */
public class StaticFactoryDemo {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.execute(() -> System.out.println(123));
        executor.execute(() -> System.out.println(456));
        executor.shutdown();
    }
}
